﻿using SLNGP.Core.Genes;
using SLNGP.Core.GeneticPrograms;

namespace SLNGP.Core.Individuals
{
    public interface IChromosome
    {
        /// <summary>
        /// Gets a language agnostic string display.
        /// </summary>
        string GetStringDisplay();

        /// <summary>
        /// The root/first gene in the Genetic Programming Tree. 
        /// </summary>
        IGene RootGene { get; set; }

        /// <summary>
        /// Gets a value indicating whether the chromosome is valid.
        /// </summary>
        bool IsValid { get; }

        /// <summary>
        /// If the current individual does not have a valid genotype, initiates a self fix. 
        /// </summary>
        void Fix();

        /// <summary>
        /// Clone chromosome for child creation. 
        /// </summary>
        /// <returns>Cloned child chromosome.</returns>
        /// <param name="parentIndividual">The parent cloned individual.</param>
        IChromosome CloneChild(IIndividual parentIndividual);

        IGeneticProgram ParentGeneticProgram { get; }
        IIndividual ParentIndividual { get; set; }
    }
}


